/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "eme_accidente")
@NamedQueries({
    @NamedQuery(name = "EmeAccidente.findAll", query = "SELECT e FROM EmeAccidente e")})
public class EmeAccidente implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "eac_id")
    private Integer eacId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 128)
    @Column(name = "eac_nombre")
    private String eacNombre;
    @Column(name = "eac_puntaje")
    private Integer eacPuntaje;
    @Basic(optional = false)
    @NotNull
    @Column(name = "eac_estado")
    private int eacEstado;
    @OneToMany(mappedBy = "emeAccidente", fetch = FetchType.LAZY)
    private List<EmeTriaje> emeTriajeList;

    public EmeAccidente() {
    }

    public EmeAccidente(Integer eacId) {
        this.eacId = eacId;
    }

    public EmeAccidente(Integer eacId, String eacNombre, int eacEstado) {
        this.eacId = eacId;
        this.eacNombre = eacNombre;
        this.eacEstado = eacEstado;
    }

    public Integer getEacId() {
        return eacId;
    }

    public void setEacId(Integer eacId) {
        this.eacId = eacId;
    }

    public String getEacNombre() {
        return eacNombre;
    }

    public void setEacNombre(String eacNombre) {
        this.eacNombre = eacNombre;
    }

    public Integer getEacPuntaje() {
        return eacPuntaje;
    }

    public void setEacPuntaje(Integer eacPuntaje) {
        this.eacPuntaje = eacPuntaje;
    }

    public int getEacEstado() {
        return eacEstado;
    }

    public void setEacEstado(int eacEstado) {
        this.eacEstado = eacEstado;
    }

    public List<EmeTriaje> getEmeTriajeList() {
        return emeTriajeList;
    }

    public void setEmeTriajeList(List<EmeTriaje> emeTriajeList) {
        this.emeTriajeList = emeTriajeList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (eacId != null ? eacId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EmeAccidente)) {
            return false;
        }
        EmeAccidente other = (EmeAccidente) object;
        if ((this.eacId == null && other.eacId != null) || (this.eacId != null && !this.eacId.equals(other.eacId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.EmeAccidente[ eacId=" + eacId + " ]";
    }
    
}
